<template>
    <ul>
        <li v-for="item of msg" :key="item.id" @click="jump(item.id)">
            <img :src="item.imgUrl" alt="">
            <p>{{item.name}}</p>
        </li>
    </ul>
</template>

<script>
    import {getBanner} from "../../api";

    export default {
        name: "HomeTuiJianNavzxw",
        data(){
            return{
                msg:[]
            }
        },
        mounted() {
            getBanner('/home-nav')
                .then(response=>{
                    this.msg = response.data
                })
        },
        methods:{
            jump(id){
                if (id===0){
                    this.$router.push('/xinpinshoufa-allnewshop-view')
                }
            }
        }
    }
</script>

<style scoped>
    ul{
        width: 98%;
        height: 200px;
        margin: 0 auto;
    }
    ul>li{
        float: left;
        width: 20%;
        margin-top: 10px;
    }
    img{
        width: 58px;
        height: 58px;
        display: block;
        margin: 0 auto;
    }
    p{
        font-size: 12px;
        text-align: center;
    }
</style>